package client;

import java.rmi.Naming;

import systemServer.general.IConnection;


public class RMIServiceLocator {
	private IConnection connection;
	
	public RMIServiceLocator(){ 
	     
    }

	public void setService(String[] args) {
    	// Add your code to get the TARGET reference HERE
    	try {
			String name = "//" + args[0] + ":" + args[1] + "/" + args[2];
			connection = (IConnection) Naming.lookup(name);
			
		} catch (Exception e) {
			System.err.println("ERROR");
			e.printStackTrace();
		}
    }
	
	public IConnection getService() {
		return connection;
	}
}
